import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import App from "../App";

import HaveClocked from "@/views/admin/HaveClocked"
import NotClocked from "@/views/admin/NotClocked"
import Update from "@/views/admin/Update"
import AddUser from "@/views/admin/AddUser"
import Users from "@/views/admin/Users"

import Clock from "@/views/user/Clock"
import Personal from "@/views/user/Personal"
import Clocked from "@/views/user/Clocked"
import UpdateOneself from "@/views/user/UpdateOneself"

import AdminIndex from "@/views/AdminIndex"
import Login from "@/views/Login"
import UserIndex from "@/views/UserIndex"

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: "Login",
      component: Login,
    },
    {
      path: '/personal',
      name: '菜单一',
      component: UserIndex,
      redirect: "/personal",
      children: [
        {
          path: '/clock',
          name: "打卡",
          component: Clock,
        },
        {
          path: '/personal',
          name: "个人信息",
          component: Personal
        },
        {
          path: '/clocked',
          name: "登记记录",
          component: Clocked
        },
        {
          path: '/updateOneself',
          name: "修改密码",
          component: UpdateOneself
        },
      ]
    },
    {
      path: '/users',
      name: '菜单一',
      component: AdminIndex,
      redirect: "/users",
      children: [
        {
          path: '/users',
          name: "用户名单",
          component: Users
        },
        {
          path: '/notClocked',
          name: "今日未登记",
          component: NotClocked
        },
        {
          path: '/haveClocked',
          name: "今日已登记",
          component: HaveClocked
        },
        {
          path: '/update',
          name: "修改用户",
          component: Update
        },
        {
          path: '/addUser',
          name: "添加新学生",
          component: AddUser
        }
      ]
    },
  ],
  mode:"history"
})
